-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Extract TraitImplHeader in AST/HIR #144386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt HIR ty lowering was modified cc @fmease Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
This comment has been minimized.
This comment has been minimized.
I don't think that's true fwiw. |
This comment has been minimized.
This comment has been minimized.
This means this PR change the code in |
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
I'll perf this due to the added indirection for impl "modifiers" + extra alloc + size changes. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Extract ImplOfTrait in AST/HIR
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this PR can't proceed without T-lang involvement and crater. This restricts Rust's stable grammar which is a breaking change.
Moreover, speaking from my experience it's quite unlikely that T-lang will approve narrowing the grammar since the general tendency has been to relax the grammar.
@bors try cancel |
@bors r=fmease Thanks for reviewing! |
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
Rollup of 15 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144386 (Extract TraitImplHeader in AST/HIR) - #144542 (Stabilize `sse4a` and `tbm` target features) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145260 (Make explicit guarantees about `Vec`’s allocator) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) r? `@ghost` `@rustbot` modify labels: rollup
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
Rollup of 14 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144210 (std: thread: Return error if setting thread stack size fails) - #144386 (Extract TraitImplHeader in AST/HIR) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) r? `@ghost` `@rustbot` modify labels: rollup
Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
Rollup of 17 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144210 (std: thread: Return error if setting thread stack size fails) - #144386 (Extract TraitImplHeader in AST/HIR) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145260 (Make explicit guarantees about `Vec`’s allocator) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) - #145283 (Make I-miscompile imply I-prioritize) - #145291 (bootstrap: Only warn about `rust.debug-assertions` if downloading rustc) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 17 pull requests Successful merges: - #131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - #139806 (std: sys: pal: uefi: Overhaul Time) - #144386 (Extract TraitImplHeader in AST/HIR) - #144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - #145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - #145214 (fix: re-enable self-assignment) - #145216 (rustdoc: correct negative-to-implicit discriminant display) - #145238 (Tweak invalid builtin attribute output) - #145249 (Rename entered trace span variables from `_span` to `_trace`) - #145251 (Support using #[unstable_feature_bound] on trait) - #145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - #145260 (Make explicit guarantees about `Vec`’s allocator) - #145263 (Update books) - #145273 (Account for new `assert!` desugaring in `!condition` suggestion) - #145283 (Make I-miscompile imply I-prioritize) - #145291 (bootstrap: Only warn about `rust.debug-assertions` if downloading rustc) - #145292 (Fix a typo in range docs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #144386 - camsteffen:imploftrait, r=fmease Extract TraitImplHeader in AST/HIR Several fields of `Impl` are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.
I guess the perf improvement was a farce. |
Rollup of 17 pull requests Successful merges: - rust-lang/rust#131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - rust-lang/rust#139806 (std: sys: pal: uefi: Overhaul Time) - rust-lang/rust#144386 (Extract TraitImplHeader in AST/HIR) - rust-lang/rust#144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - rust-lang/rust#145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - rust-lang/rust#145214 (fix: re-enable self-assignment) - rust-lang/rust#145216 (rustdoc: correct negative-to-implicit discriminant display) - rust-lang/rust#145238 (Tweak invalid builtin attribute output) - rust-lang/rust#145249 (Rename entered trace span variables from `_span` to `_trace`) - rust-lang/rust#145251 (Support using #[unstable_feature_bound] on trait) - rust-lang/rust#145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - rust-lang/rust#145260 (Make explicit guarantees about `Vec`’s allocator) - rust-lang/rust#145263 (Update books) - rust-lang/rust#145273 (Account for new `assert!` desugaring in `!condition` suggestion) - rust-lang/rust#145283 (Make I-miscompile imply I-prioritize) - rust-lang/rust#145291 (bootstrap: Only warn about `rust.debug-assertions` if downloading rustc) - rust-lang/rust#145292 (Fix a typo in range docs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 17 pull requests Successful merges: - rust-lang/rust#131477 (Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var) - rust-lang/rust#139806 (std: sys: pal: uefi: Overhaul Time) - rust-lang/rust#144386 (Extract TraitImplHeader in AST/HIR) - rust-lang/rust#144921 (Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]`) - rust-lang/rust#145155 (Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)) - rust-lang/rust#145214 (fix: re-enable self-assignment) - rust-lang/rust#145216 (rustdoc: correct negative-to-implicit discriminant display) - rust-lang/rust#145238 (Tweak invalid builtin attribute output) - rust-lang/rust#145249 (Rename entered trace span variables from `_span` to `_trace`) - rust-lang/rust#145251 (Support using #[unstable_feature_bound] on trait) - rust-lang/rust#145253 (Document compiler and stdlib in stage1 in `pr-check-2` CI job) - rust-lang/rust#145260 (Make explicit guarantees about `Vec`’s allocator) - rust-lang/rust#145263 (Update books) - rust-lang/rust#145273 (Account for new `assert!` desugaring in `!condition` suggestion) - rust-lang/rust#145283 (Make I-miscompile imply I-prioritize) - rust-lang/rust#145291 (bootstrap: Only warn about `rust.debug-assertions` if downloading rustc) - rust-lang/rust#145292 (Fix a typo in range docs) r? `@ghost` `@rustbot` modify labels: rollup
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [syn](https://redirect.github.com/dtolnay/syn) | workspace.dependencies | patch | `2.0.104` -> `2.0.106` | --- ### Release Notes <details> <summary>dtolnay/syn (syn)</summary> ### [`v2.0.106`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.106) [Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.105...2.0.106) - Replace `~const` syntax with `[const]` conditionally const syntax in trait bounds ([#​1896](https://redirect.github.com/dtolnay/syn/issues/1896), [rust-lang/rust#139858](https://redirect.github.com/rust-lang/rust/pull/139858)) - Support conditionally const impl Trait types ([#​1897](https://redirect.github.com/dtolnay/syn/issues/1897)) - Reject polarity modifier and lifetime binder used in the same trait bound ([#​1899](https://redirect.github.com/dtolnay/syn/issues/1899), [rust-lang/rust#127054](https://redirect.github.com/rust-lang/rust/pull/127054)) - Parse const trait bounds with bound lifetimes ([#​1902](https://redirect.github.com/dtolnay/syn/issues/1902)) - Parse bound lifetimes with lifetime bounds ([#​1903](https://redirect.github.com/dtolnay/syn/issues/1903)) - Allow type parameters and const parameters in trait bounds and generic closures ([#​1904](https://redirect.github.com/dtolnay/syn/issues/1904), [#​1907](https://redirect.github.com/dtolnay/syn/issues/1907), [#​1908](https://redirect.github.com/dtolnay/syn/issues/1908), [#​1909](https://redirect.github.com/dtolnay/syn/issues/1909)) ### [`v2.0.105`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.105) [Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.104...2.0.105) - Disallow "negative" inherent impls like `impl !T {}` ([#​1881](https://redirect.github.com/dtolnay/syn/issues/1881), [rust-lang/rust#144386](https://redirect.github.com/rust-lang/rust/pull/144386)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 05:59 AM, on day 24 of the month ( * 0-5 24 * * ) (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/jerus-org/captval). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44MS4yIiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [syn](https://redirect.github.com/dtolnay/syn) | workspace.dependencies | patch | `2.0.104` -> `2.0.106` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>dtolnay/syn (syn)</summary> ### [`v2.0.106`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.106) [Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.105...2.0.106) - Replace `~const` syntax with `[const]` conditionally const syntax in trait bounds ([#​1896](https://redirect.github.com/dtolnay/syn/issues/1896), [rust-lang/rust#139858](https://redirect.github.com/rust-lang/rust/pull/139858)) - Support conditionally const impl Trait types ([#​1897](https://redirect.github.com/dtolnay/syn/issues/1897)) - Reject polarity modifier and lifetime binder used in the same trait bound ([#​1899](https://redirect.github.com/dtolnay/syn/issues/1899), [rust-lang/rust#127054](https://redirect.github.com/rust-lang/rust/pull/127054)) - Parse const trait bounds with bound lifetimes ([#​1902](https://redirect.github.com/dtolnay/syn/issues/1902)) - Parse bound lifetimes with lifetime bounds ([#​1903](https://redirect.github.com/dtolnay/syn/issues/1903)) - Allow type parameters and const parameters in trait bounds and generic closures ([#​1904](https://redirect.github.com/dtolnay/syn/issues/1904), [#​1907](https://redirect.github.com/dtolnay/syn/issues/1907), [#​1908](https://redirect.github.com/dtolnay/syn/issues/1908), [#​1909](https://redirect.github.com/dtolnay/syn/issues/1909)) ### [`v2.0.105`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.105) [Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.104...2.0.105) - Disallow "negative" inherent impls like `impl !T {}` ([#​1881](https://redirect.github.com/dtolnay/syn/issues/1881), [rust-lang/rust#144386](https://redirect.github.com/rust-lang/rust/pull/144386)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/astral-sh/ruff). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi43IiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [syn](https://redirect.github.com/dtolnay/syn) | workspace.dependencies | patch | `2.0.104` -> `2.0.106` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>dtolnay/syn (syn)</summary> ### [`v2.0.106`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.106) [Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.105...2.0.106) - Replace `~const` syntax with `[const]` conditionally const syntax in trait bounds ([#​1896](https://redirect.github.com/dtolnay/syn/issues/1896), [rust-lang/rust#139858](https://redirect.github.com/rust-lang/rust/pull/139858)) - Support conditionally const impl Trait types ([#​1897](https://redirect.github.com/dtolnay/syn/issues/1897)) - Reject polarity modifier and lifetime binder used in the same trait bound ([#​1899](https://redirect.github.com/dtolnay/syn/issues/1899), [rust-lang/rust#127054](https://redirect.github.com/rust-lang/rust/pull/127054)) - Parse const trait bounds with bound lifetimes ([#​1902](https://redirect.github.com/dtolnay/syn/issues/1902)) - Parse bound lifetimes with lifetime bounds ([#​1903](https://redirect.github.com/dtolnay/syn/issues/1903)) - Allow type parameters and const parameters in trait bounds and generic closures ([#​1904](https://redirect.github.com/dtolnay/syn/issues/1904), [#​1907](https://redirect.github.com/dtolnay/syn/issues/1907), [#​1908](https://redirect.github.com/dtolnay/syn/issues/1908), [#​1909](https://redirect.github.com/dtolnay/syn/issues/1909)) ### [`v2.0.105`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.105) [Compare Source](https://redirect.github.com/dtolnay/syn/compare/2.0.104...2.0.105) - Disallow "negative" inherent impls like `impl !T {}` ([#​1881](https://redirect.github.com/dtolnay/syn/issues/1881), [rust-lang/rust#144386](https://redirect.github.com/rust-lang/rust/pull/144386)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/astral-sh/uv). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi43IiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Several fields of
Impl
are only applicable when it's a trait impl. This moves those fields into a new struct that is only present for trait impls.